package com.itheima.day16_多态接口.deno06;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

/*
定义动物类 属性:年龄行为:喝水,吃东西【吃什么不确定】
 */
public abstract class Animal {
    private int age;

    public Animal() {
    }

    public Animal(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void Water(){
        System.out.println("喝水");
    }
    public abstract void eat();
}
//定义狗类 行为:吃饭(啃骨头)和 游泳(狗刨)
class Dog extends Animal implements Swim{
    @Override
    public void eat(){
        System.out.println("狗啃骨头");
    }
    public void swim(){
        System.out.println("狗会狗刨游泳");
    }
}
//定义羊类: 行为:吃饭(羊啃草)
class Sheep extends Animal{

    @Override
    public void eat() {
        System.out.println("羊啃草");
    }
}
//定义青蛙类: 行为:吃饭(吃虫子)和 游泳(蛙泳)
class Frog extends Animal implements Swim{

    @Override
    public void eat() {
        System.out.println("青蛙吃小虫");
    }
    public void swim(){
        System.out.println("青蛙会蛙泳");
    }
}

